home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / menumanager.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-11-15  |  2.9 KB  |  80 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.     begin                : Jan 2005
  9.     copyright            : (C) 2005 by Craig Bradney
  10.     email                : cbradney@zip.com.au
  11.  ***************************************************************************/
  12.  
  13. /***************************************************************************
  14.  *                                                                         *
  15.  *   This program is free software; you can redistribute it and/or modify  *
  16.  *   it under the terms of the GNU General Public License as published by  *
  17.  *   the Free Software Foundation; either version 2 of the License, or     *
  18.  *   (at your option) any later version.                                   *
  19.  *                                                                         *
  20.  ***************************************************************************/
  21. #ifndef MENUMANAGER_H
  22. #define MENUMANAGER_H
  23.  
  24. #include <QAction>
  25. #include <QObject>
  26. #include <QPoint>
  27. #include <QMenu>
  28.  
  29. class QMenuBar;
  30.  
  31. #include "scribusapi.h"
  32. class ScrAction;
  33. class ScrPopupMenu;
  34. class ScribusMainWindow;
  35.  
  36. /**
  37. @author Craig Bradney
  38. */
  39. class SCRIBUS_API MenuManager : public QObject
  40. {
  41.     Q_OBJECT
  42. public:
  43.     MenuManager(QMenuBar* mb, QObject *parent = 0);
  44.     ~MenuManager();
  45.  
  46.     enum MenuType {Normal, DLL};
  47.  
  48.     bool createMenu(const QString &menuName, const QString &menuText = QString::null, const QString parent = QString::null, bool checkable = false);
  49.     bool addMenuToMenu(const QString & child, const QString &parent);
  50.     bool deleteMenu(const QString &menuName, const QString &parent = QString::null);
  51.     bool clearMenu(const QString &menuName);
  52.     void setText(const QString &menuName, const QString &menuText);
  53.     void setMenuIcon(const QString &menuName, const QIcon &menuIcon);
  54.     QMenu *getLocalPopupMenu(const QString &menuName);
  55.     void setMenuEnabled(const QString &menuName, const bool enabled);
  56.     bool addMenuToMenuBar(const QString &menuName);
  57.     bool addMenuToMenuBarBefore(const QString &, const QString &);
  58.     bool removeMenuFromMenuBar(const QString &menuName);
  59.     bool addMenuToWidgetOfAction(const QString &menuName, ScrAction *action);
  60.  
  61.     bool addMenuItem(ScrAction *menuAction, const QString &parent);
  62.     bool addMenuItemAfter(ScrAction *menuAction, const QString &parent, ScrAction *afterMenuAction);
  63.     bool addMenuSeparator(const QString &parent);
  64.  
  65.     bool removeMenuItem(ScrAction *menuAction, const QString &parent);
  66.  
  67.     void runMenuAtPos(const QString &, const QPoint);
  68.  
  69.     void generateKeyManList(QStringList *actionNames);
  70.     bool empty();
  71.     bool menuExists(const QString &menuName);
  72.  
  73. private:
  74.     QMenuBar *scribusMenuBar;
  75.     QMap<QString, ScrPopupMenu *> menuList;
  76. };
  77.  
  78. #endif
  79.  
  80.